package com.zksk.admin.api;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.zksk.admin.api.domain.portal.vo.PolicyInfoVo;
import com.zksk.admin.api.factory.RemotePolicyFallbackFactory;
import com.zksk.common.core.constant.SecurityConstants;
import com.zksk.common.core.constant.ServiceNameConstants;
import com.zksk.common.core.domain.R;
import com.zksk.mbg.admin.domain.PolicyInfo;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 政策咨询相关模块
 *
 * @author zksk
 */
@FeignClient(contextId = "RemotePolicyService", value = ServiceNameConstants.SYSTEM_SERVICE, fallbackFactory = RemotePolicyFallbackFactory.class)
public interface RemotePolicyService {
    /**
     * 获取政策资讯分页列表
     * @param policyInfoVo
     * @param source
     * @return
     */
    @PostMapping("/portal/policy/list")
    public R<Page<PolicyInfo>> list(@RequestBody PolicyInfoVo policyInfoVo,
                                    @RequestHeader(SecurityConstants.FROM_SOURCE) String source);

    /**
     * 根据政策咨询id查询资讯信息
     * @param id
     * @return
     */
    @GetMapping(value = "/portal/policy/{id}")
    public R<PolicyInfo> select(@PathVariable(value = "id") Long id,
                                @RequestHeader(SecurityConstants.FROM_SOURCE) String source) ;


}
